import {Component} from '@angular/core';
import {DynamicDialogRef, MessageService} from "primeng/api";
import {Form} from "../../../../../projects/geminis-ng/src/api/Form";

@Component({
  selector: 'app-button-dialog-demo',
  templateUrl: './DemoDialog.component.html'
})
export class DemoDialogComponent extends Form {

  constructor(private messageService: MessageService,
              private dialogRef: DynamicDialogRef) {
    super();
  }

  confirm(): void {
    this.messageService.add({severity: 'success', summary: '成功', detail: '信息已保存', sticky: true});
    this.dialogRef.close({value: 'ok'});
  }
}
